<?php

declare(strict_types=1);

namespace App\Chat\Listener;

use App\Chat\Event\TalkRecordEvent;
use App\Chat\Service\TalkService;
use Hyperf\Event\Annotation\Listener;
use Hyperf\Event\Contract\ListenerInterface;

#[Listener]
class TalkRecordListener implements ListenerInterface
{
    public function listen(): array
    {
        return [
            TalkRecordEvent::class
        ];
    }

    public function process(object $event): void
    {
        di()->get(TalkService::class)->saveChatRecord($event->robot,$event->data);
    }

}